﻿namespace Cos.Module.Form.NHibernate.Test
{
    using System;
    using System.Collections.Generic;

    using Cos.Core.NHibernate;
    using Cos.Core.NHibernate.Tests;

    using NUnit.Framework;

    [TestFixture]
    public class FormDataModelFixture : ModuleFixtureBase
    {
        [Test]
        public void CanMapFormDataModel()
        {
            new PersistenceSpecification<FormDataModel>(Session)
                .CheckProperty(x => x.AnswerOnce, false)
                .CheckProperty(x => x.ApprobationDate, new DateTime(2011, 01, 04))
                .CheckProperty(x => x.Author, "Bill Smith")
                .CheckProperty(x => x.ConfirmEmail, string.Empty)
                .CheckProperty(x => x.CreationDate, new DateTime(2011, 01, 04))
                .CheckProperty(x => x.CSS, string.Empty)
                .CheckProperty(x => x.DisplayType, "LabelLeft")
                .CheckProperty(x => x.EmailFrom, "test@cameleon.com")
                //.CheckComponentList(x => x.FormCultures, new List<FormCultureDataModel>())
                //.CheckComponentList(x => x.FormElements, new List<FormElementDataModel>())
                //.CheckComponentList(x => x.FormPages, new List<FormPageDataModel>())
                .CheckProperty(x => x.IsDeleted, false)
                .CheckProperty(x => x.Kickback, null)
                .CheckProperty(x => x.LastModifiedDate, new DateTime(2011, 01, 04))
                .CheckProperty(x => x.Name, "Form")
                .CheckProperty(x => x.PageCss, "CSS")
                .CheckProperty(x => x.ReturnUrl, string.Empty)
                .CheckProperty(x => x.SelectedPageCss, "CSS")
                .CheckProperty(x => x.ShowAsSurvey, false)
                .CheckProperty(x => x.ShowSummary, false)
                .VerifyTheMappings();
        }
    }
}
